package com.digitalchina.lxnsy.viewholder;

import android.view.ViewGroup;
import android.widget.TextView;

import com.digitalchina.lxnsy.R;
import com.digitalchina.lxnsy.entity.FarmingInfoListVO;
import com.digitalchina.lxnsy.toolkit.FrescoUtil;
import com.facebook.drawee.view.SimpleDraweeView;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.viewholder
 * 创建人：郑皓
 * 创建时间：2018/8/6 11:10
 * 修改备注：
 * ================================================
 */

public class FarmingInfoHolder extends BaseViewHolder<FarmingInfoListVO> {

    private SimpleDraweeView ivPicture;
    private TextView tvType;
    private TextView tvAuthor;
    private TextView tvTitle;
    private TextView tvTime;


    public FarmingInfoHolder(ViewGroup parent) {
        super(parent, R.layout.item_information_list);
        ivPicture = $(R.id.sdv_images);
        tvTitle = $(R.id.tv_title);
        tvType = $(R.id.tv_type);
        tvAuthor = $(R.id.tv_author);
        tvTime = $(R.id.tv_time);
    }

    @Override
    public void setData(FarmingInfoListVO data) {
        super.setData(data);

        FrescoUtil.showImageSmall(data.getImgUrl(), ivPicture);
        tvType.setText(data.getNewsTypeName() + "");
        tvAuthor.setText(data.getAuthor() + "");
        tvTitle.setText(data.getTitle() + "");
        tvTime.setText(data.getCreateTime() + "");

    }

}
